package cn.antia.db;

import cn.antia.cwin.common.CwinLog;

/**
 * User: Jair Shaw
 * Date: 2008-6-30
 * Time: 10:59:55
 */
public class MySQLSQLGene extends AbstractSQLGene{
    public MySQLSQLGene() {
        CwinLog.info("MySQLSQLGene created...");
    }

    public String composeSql(String sql, String orderField, boolean isAsc, int start, int end) {
        sql = cutOrderBySql(sql);
        sql = new StringBuilder(sql).append(" ORDER BY ").append(orderField).append(isAsc ? " ASC " : " DESC ").append(" LIMIT ").append(start).append(",").append(end - start).toString();
        return sql;
    }
    
}
